/*
 * @LastEditors: Yang.Zzz
 * @LastEditTime: 2024-05-17 15:03:02
 */
// router/index.js  
import { createRouter, createWebHistory } from 'vue-router';  
import LoginView from '../views/LoginView.vue';  
import RegisterView from '../views/registerView.vue';  
import HomePageView  from '../views/homePage.vue';
import taskListPageView  from '../views/taskListPage.vue';

const routes = [  
  {  
    path: '/login',  
    name: 'login',  
    component: LoginView  
  }, 
  {  
    path: '/register',  
    name: 'register',  
    component: RegisterView  
  }, 
  {
    path: '/webapp',  
    name: 'webapp',  
    component: HomePageView,
    children: [
      {
        path:'',
        name:'default',
        redirect: '/webapp/tasks/all'
      },
      {  
        path: 'tasks/:varietyId', // 任务id
        component: taskListPageView  
      },
      {  
        path: 'tasks/:varietyId/:taskId', // 任务id
        component: taskListPageView  
      }
    ]  
  }
];  
  
const router = createRouter({  
//   history: createWebHistory(process.env.BASE_URL),  
    history: createWebHistory(),
    routes,  
});  
  
export default router;